#!/usr/bin/env python
# Copyright (C) 2007 by Xyhthyx <xyhthyx@gmail.com>

# This file is part of Parcelle.

# Parcelle is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.

# Parcelle is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import gtk.glade
import common

# Widgets used by control.preferences
class PreferencesWidgets:
    
	def __init__(self):
		
 		# Set the Glade file
 		self.gladefile = gtk.glade.XML(common.PREF_GLADE_FILE, common.PREF_FORM_NAME)
 		
 		# Form dialog widget
 		self.frmPreferences = self.gladefile.get_widget(common.PREF_FORM_NAME)
 		
 		# Preferences widgets
 		self.chkAppend = self.gladefile.get_widget('chkAppend')
 		self.chkBrowse = self.gladefile.get_widget('chkBrowse')
 		self.chkHyperlinks = self.gladefile.get_widget('chkHyperlinks')
 		self.chkStartup = self.gladefile.get_widget('chkStartup')
 		self.chkWarning = self.gladefile.get_widget('chkWarning')
 		self.rdoClipboard = self.gladefile.get_widget('rdoClipboard')
 		self.rdoPrimary = self.gladefile.get_widget('rdoPrimary')
 		self.spnRecent = self.gladefile.get_widget('spnRecent')
 		self.spnRemember = self.gladefile.get_widget('spnRemember')
		
		# -------------------------------
		#  Make modifications to widgets
		# -------------------------------
		
		# Misc building
		icon = self.frmPreferences.render_icon(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_MENU)
		self.frmPreferences.set_icon(icon)
		self.frmPreferences.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)
